#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include<math.h>

int main() {
    int a, b;
    while (scanf("%d %d", &a, &b) != EOF) 
    {
        int count = 0;
        for (int i = a; i <= b; i++)
        {
            int j = i;
            int sum = 0;
            int n = 0;
            //这一步计算该数为几位数
            while (j)
            {
                j = j / 10;
                n++;
            }
            //重新赋值j
            j = i;
            while (j)
            {
                sum += pow(j % 10, n);
                j = j / 10;
            }
            if (sum == i)
            {
                printf("%d ", i);
                count++;
            }
        }
        if (count)
        {
            printf("\n");
        }
        else
        {
            printf("no\n");
        }

    }
    return 0;
}